The present disclosure generally relates to logical partitions in a computing system, and more specifically, to techniques that allow a guest operating systems (on a computing system) to invalidate translation look-aside buffer entries.
Administrators often logically partition the resources of computing systems through virtualization. These resources can include processors, memory, storage, etc. A hypervisor is used to expose virtualized computing hardware to different logical partitions (or virtual machines). Each logical partition can run a different operating system (OS). The hypervisor can provide each OS with a set of virtualized computing hardware.
Further, processors include at least one memory management unit (MMU) for performing virtual to physical address translations. For example, the processor may assign blocks of virtual memory to different processes executing on the processor (e.g., operating systems or user applications). Each of the virtual addresses corresponds to a physical memory address in memory. The mappings between the virtual and physical addresses are stored in a page table as page table entries. When a process sends a request to a processing core to read data from, or write data to, a particular virtual address, the MMU queries the page table (or a translation lookaside buffer (TLB)) to identify the corresponding physical address. The processing core then uses the physical address to perform the read or write requested by the process.
The TLB is generally a cache of the page table, representing a subset of the page table contents. In general, it is quicker for a processor to access the TLB for a translation than for the processor to access the page table (which is typically stored in main memory). In some cases, however, the entries in the TLB may become invalid, e.g., due to a process switch in which the processor goes from executing one process (which uses one virtual to physical mapping) to another process (which uses a different virtual to physical mapping).
Generally, before any TLB entry is invalidated, the operating system has to call the hypervisor which is tasked with invaliding TLB entries. Doing so in this manner prevents operating systems, which may pose security threats, from affecting other operating systems in the computing system. At the same time, however, using the hypervisor to invalidate TLB entries can be inefficient for large numbers of operating systems (e.g., as a large number of instructions may have to be executed before a TLB entry is invalidated).